
/// Solves a linear system of the form a x = b using LU decomposition.
/// @arg a pointer to an array of doubles containing a square matrix stored row by row.
/// @arg b pointer to an array of doubles containing the independent terms for each row.
/// @arg x pointer to an array of doubles which will contain the result .
/// @arg n number of equations in the system, i.e., rows and columns of a, b, and x.
/// @return True if the system is not singular.
bool solve (double* a, double * b, double * x, size_t n);

/// Inverts a square n x n matrix.
/// @arg a pointer to an array of doubles containing a square matrix stored row by row.
/// @arg inv pointer to an array of doubles which will contain the inverse of a.
/// @arg n number of rows and columns in both a and inv.
/// @return True if inversion was possible (non-singular matrix).
bool invert(double* a, double* inv, size_t n);

/// Multiplies two square matrices.
/// @arg a matrix of size n x n stored row by row in an array.
/// @arg b matrix of size n x n stored row by row in an array.
/// @arg c matrix of size n x n stored row by row in an array containing the product of a and b.
/// @arg n number of rows and columns.
void matmatmult (double* a, double *b, double *c, size_t n);

/// Multiplies a square matrix by a vector returning a vector.
/// @arg a matrix of size n x n stored row by row in an array.
/// @arg b vector of size n.
/// @arg c vector of size n containing the product of a and b.
/// @arg n number of rows and columns.
void matvecmult (double* a, double *b, double *c, size_t n);
